import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:"/login"
  },
  {
    path: '/shop',
    name: 'shop',
    component: ()=>import("../views/Basics/shop.vue")
  },
  {
    path: '/transaction',
    name: 'transaction',
    component: ()=>import("../views/order/transaction.vue")
  },
  {
    path: '/user',
    name: 'user',
    component: ()=>import("../views/system/user.vue")
  },
  {
    path: '/menu',
    name: 'menu',
    component: ()=>import("../views/system/menu.vue")
  },
  {
    path: '/role',
    name: 'role',
    component: ()=>import("../views/system/role.vue")
  },
  {
    path: '/company',
    name: 'company',
    component: ()=>import("../views/system/company.vue")
  },
  {
    path: '/Environmental',
    name: 'Environmental',
    component: ()=>import("../views/system/Environmental.vue")
  },
  {
    path: '/jurisdiction',
    name: 'jurisdiction',
    component: ()=>import("../views/system/jurisdiction.vue")
  },
  {
    path: '/login',
    name: 'login',
    component: ()=>import("../views/login.vue")
  },
 

  
]

const router = new VueRouter({
  routes
})


// //路由的全局守卫
// router.beforeEach((to,from,next)=>{
//   if(localStorage.getItem('token')){
//     next()
//   }else{
//     if(to.path=="/login"){
//       next()
//     }else{
//       next('/login')
//     }
//   }
// })


export default router
